import pandas as pd
from .feature_decorator import support_predict

@support_predict
def prepare_features(df):
    """分离年月作特征数据"""
    df['year'] = pd.to_datetime(df.iloc[:, 0]).dt.year
    df['month'] = pd.to_datetime(df.iloc[:, 0]).dt.month
    X = df[['year', 'month']].values
    y = df.iloc[:, 1].values
    return X, y